package com.jjsc.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jjsc.product.domain.ProductSpec;
import com.jjsc.product.service.IProductSpecService;
import com.jjsc.product.mapper.ProductSpecMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 41254
* @description 针对表【product_spec(商品规格)】的数据库操作Service实现
* @createDate 2025-10-19 17:00:39
*/
@Service
public class ProductSpecServiceImpl extends ServiceImpl<ProductSpecMapper, ProductSpec>
    implements IProductSpecService {


    @Override
    public List<ProductSpec> selectProductSpecList(ProductSpec productSpec) {

        return baseMapper.selectProductSpecList(productSpec);
    }

    @Override
    public ProductSpec selectProductSpecById(Long id) {
        return baseMapper.selectById(id);
    }

    @Override
    public List<ProductSpec> selectProductSpecListByCategoryId(Long categoryId) {

        return baseMapper.selectList(new
                LambdaQueryWrapper<ProductSpec>()
                .eq(ProductSpec::getCategoryId, categoryId)
        );
    }
}




